package com.example.demo.properties.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.properties.prop.AppAwoProperties;
import com.example.demo.properties.prop.MyTestProperties;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "4 配置文件类测试")
@RestController
@RequestMapping("/awo")
public class PropertiesController {
    private static final Logger logger = LoggerFactory.getLogger(PropertiesController.class);

    @Autowired
    AppAwoProperties awoProperties;

    @Autowired
    MyTestProperties myTestProperties;

    @ApiOperation(value = "配置信息")
    @GetMapping("/profile")
    public String awoProfile(){
        logger.info("----------info");
        logger.debug("----------"+awoProperties.toString());
        logger.error("----------error");
        return awoProperties.toString();
    }

    @GetMapping("/my")
    public String myTestProfile(){
        return myTestProperties.toString();
    }
}
